#ifndef _BSC_GB32960_LOG_H_
#define _BSC_GB32960_LOG_H_

#include "ofc/ofc_types.h"
#include "alog/a_log.h"

#if !defined(GB32960_LOG_TAG)
#define GB32960_LOG_TAG          "32960"
#endif

#define GB32960_LOG_ERROR_LEVEL(x) (x >=0 ? kALogLevelInfo : kALogLevelError)

#define GB32960_LOG_B(error, fmt, ...) ALog(error ? kALogLevelInfo : kALogLevelError, (const Int8*)GB32960_LOG_TAG, (const Int8*)ALOG_SRC, (const Int8*)fmt, ##__VA_ARGS__)
#define GB32960_LOG_X(error, fmt, ...) ALog(GB32960_LOG_ERROR_LEVEL(error),(const Int8*)GB32960_LOG_TAG, (const Int8*)ALOG_SRC, (const Int8*)fmt, ##__VA_ARGS__)

#define GB32960_LOG(level, tag, fmt, ...) ALog(level, tag, ALOG_SRC, fmt, ##__VA_ARGS__)

#define GB32960_LOG_E(fmt, ...) ALog(kALogLevelError,   (const Int8*)GB32960_LOG_TAG, (const Int8*)ALOG_SRC, (const Int8*)fmt, ##__VA_ARGS__)
#define GB32960_LOG_W(fmt, ...) ALog(kALogLevelWarning, (const Int8*)GB32960_LOG_TAG, (const Int8*)ALOG_SRC, (const Int8*)fmt, ##__VA_ARGS__)
#define GB32960_LOG_I(fmt, ...) ALog(kALogLevelInfo,    (const Int8*)GB32960_LOG_TAG, (const Int8*)ALOG_SRC, (const Int8*)fmt, ##__VA_ARGS__)
#define GB32960_LOG_D(fmt, ...) ALog(kALogLevelDebug,   (const Int8*)GB32960_LOG_TAG, (const Int8*)ALOG_SRC, (const Int8*)fmt, ##__VA_ARGS__)
#define GB32960_LOG_T(fmt, ...) ALog(kALogLevelTrace,   (const Int8*)GB32960_LOG_TAG, (const Int8*)ALOG_SRC, (const Int8*)fmt, ##__VA_ARGS__)
#define GB32960_LOG_HEX(lvl, width, buf, buf_size)   ALogHex(lvl, (const Int8*)GB32960_LOG_TAG, ALOG_SRC, width, buf, buf_size)

const char *BsGb32960ErrorCodeToString(Int32 code);
const char *BsGb32960ErrorCodeBoolToString(Bool code);
#endif
